//
//  AppDelegate+initVendor.m
//  movie
//
//  Created by 白浩洋 on 2018/3/13.
//  Copyright © 2018年 白浩洋. All rights reserved.
//

#import "AppDelegate+initVendor.h"
#import "ViewController.h"
#import "MineViewController.h"
#import "NBALoginViewController.h"
#import "imageViewController.h"
#import "MLBasePageViewController.h"
#import "imageDetailViewController.h"
#import "zixunViewController.h"
#import "detailWebViewController.h"
#import "menuViewController.h"
#import "hotViewController.h"
#import "EMBillViewController.h"
#import "EMDiaryViewController.h"
#import "shenhemineViewController.h"
#import "EMPlaceViewController.h"

@implementation AppDelegate (initVendor)
- (void)initVendor:(NSDictionary *)launchOptions{
    [UMConfigure initWithAppkey:UMAppKey channel:@"App Store"];
    [Bmob registerWithAppKey:BMOBApid];
}
- (void)toLogin{
    NBALoginViewController *nvc = [[NBALoginViewController alloc]init];
    UINavigationController *navhc = [[UINavigationController alloc]initWithRootViewController:nvc];
    self.window.rootViewController=navhc;
}
- (void)initTabView{

        ViewController *mvc =[[ViewController alloc]init];
        UINavigationController *navmc = [[UINavigationController alloc]initWithRootViewController:mvc];
        MineViewController *minevc =[[MineViewController alloc]init];
        UINavigationController *minevcNav = [[UINavigationController alloc]initWithRootViewController:minevc];
        UITabBarController *tab = [[UITabBarController alloc]init];
        mvc.title=@"影视";
        minevc.title = @"关于我";

        [[UITabBar appearance] setTintColor:[UIColor colorWithHexString:BH_Color_Main]];
        [mvc.tabBarItem setImage: [[UIImage imageNamed:@"movie_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
        [mvc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"movie_selectd"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
        [minevc.tabBarItem setImage: [[UIImage imageNamed:@"me_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
        [minevc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"me_selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
        tab.viewControllers = @[navmc,minevcNav];
        self.window.rootViewController=tab;
        
}
- (void)initshenhe{
    EMBillViewController *hvc =[[EMBillViewController alloc]init];
    UINavigationController *hnavmc = [[UINavigationController alloc]initWithRootViewController:hvc];
    EMDiaryViewController *mvc = [[EMDiaryViewController alloc]init];
    UINavigationController *navmc = [[UINavigationController alloc]initWithRootViewController:mvc];
    EMPlaceViewController *pvc = [[EMPlaceViewController alloc]init];
    UINavigationController *navpmc = [[UINavigationController alloc]initWithRootViewController:pvc];
    shenhemineViewController*minevc =[[shenhemineViewController alloc]init];
    UINavigationController *minevcNav = [[UINavigationController alloc]initWithRootViewController:minevc];
    
    UITabBarController *tab = [[UITabBarController alloc]init];
    hvc.title = @"账单";
    mvc.title=@"日记";
    pvc.title=@"收纳";
    minevc.title = @"我的";
    [hvc.tabBarItem setImage: [[UIImage imageNamed:@"hot_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [hvc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"hot_selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [mvc.tabBarItem setImage: [[UIImage imageNamed:@"zixun_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [mvc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"zixun_selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [pvc.tabBarItem setImage: [[UIImage imageNamed:@"shouna_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [pvc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"shouna_selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [minevc.tabBarItem setImage: [[UIImage imageNamed:@"me_normal"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [minevc.tabBarItem setSelectedImage: [[UIImage imageNamed:@"me_selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [[UITabBar appearance] setTintColor:[UIColor colorWithHexString:BH_Color_Main]];
    tab.viewControllers = @[hnavmc,navmc,navpmc,minevcNav];
    self.window.rootViewController=tab;
}

@end
